part of IFinal;

//==================================== Config Server ====================================
class _IFinal_ConfigModel_Server {
  String notice = "";
  List<String> lines = [];

  _IFinal_ConfigModel_Server.fromJson(Map<String, dynamic> map) {
    notice = map["notice"]?.toString() ?? "";
    lines = ((map["lines"] ?? []) as List).map((e) => e.toString()).toList();
  }
}

//==================================== Config Local ====================================
class _IFinal_ConfigModel_Local {
  bool debug_onLine = false;
  String md5Key = "";
  List<String> config_lines = [];
  late _ThirdSDKModel third_sdk;

  _IFinal_ConfigModel_Local.fromJson(Map<String, dynamic> map) {
    debug_onLine = map["debug_onLine"] ?? false;
    md5Key = map["md5Key"]?.toString() ?? "";
    config_lines = ((map["config_lines"][(!YConfig.DEBUG || debug_onLine) ? "release" : "debug"] ?? []) as List).map((e) => e.toString()).toList();
    third_sdk = _ThirdSDKModel.fromJson(map["third_sdk"] as Map<String, dynamic>);
  }
}

class _ThirdSDKModel {
  _ThirdSDKModel();

  late _YIM yim;
  late _OSS oss;

  _ThirdSDKModel.fromJson(Map<String, dynamic>? map) {
    if (map == null) return;
    yim = _YIM.fromJson(map["yim"] as Map<String, dynamic>);
    oss = _OSS.fromJson(map["oss"] as Map<String, dynamic>);
  }
}

class _YIM {
  _YIM();

  String appKey = "";

  _YIM.fromJson(Map<String, dynamic>? map) {
    if (map == null) return;
    appKey = map["appKey"]?.toString() ?? "";
  }
}

class _OSS {
  _OSS();

  String ossEndpoint = "";
  String bucketName = "";
  String accessKey = "";
  String accessSecret = "";
  String expire = "";

  _OSS.fromJson(Map<String, dynamic>? map) {
    if (map == null) return;
    ossEndpoint = map["ossEndpoint"]?.toString() ?? "";
    bucketName = map["bucketName"]?.toString() ?? "";
    accessKey = map["accessKey"]?.toString() ?? "";
    accessSecret = map["accessSecret"]?.toString() ?? "";
    expire = map["expire"]?.toString() ?? "";
  }
}
